﻿<controls:ChildWindow
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
    x:Class="SmartSpace.UI.Silverlight.Dynamic.Controls.SelectOrgWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    Style="{StaticResource WindowStyle}"       
    Width="400"
    Height="400"
    HorizontalAlignment="Stretch"
    VerticalAlignment="Stretch"
    Title="选择承办单位" UseLayoutRounding="True">
    <toolkit:BusyIndicator Name="m_busy">
        <Grid x:Name="LayoutRoot" Margin="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Border BorderThickness="1" Grid.Row="0">
                <sdk:TreeView x:Name="m_treeViewOrganizations"  >
                    <sdk:TreeView.ItemTemplate>
                        <sdk:HierarchicalDataTemplate ItemsSource="{Binding Children}">
                            <StackPanel Orientation="Horizontal">
                                <CheckBox IsChecked="{Binding Path=IsSelected, Mode=TwoWay}"/>
                                <TextBlock Text="{Binding Path=Caption}"/>
                            </StackPanel>
                        </sdk:HierarchicalDataTemplate>
                    </sdk:TreeView.ItemTemplate>
                </sdk:TreeView>
            </Border>
            <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Right">
                <Button Name="m_buttonClear" Click="m_buttonClear_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="../../Resources/Delete.png" Margin="0,0,4,0"/>
                        <TextBlock Text="清空" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button Name="m_buttonOK" Click="m_buttonOK_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="../../Resources/Accept.png" Margin="0,0,4,0"/>
                        <TextBlock Text="确定" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button Name="m_buttonCancel" Click="m_buttonCancel_Click">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="../../Resources/Cancel.png" Margin="0,0,4,0"/>
                        <TextBlock Text="返回" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
            </StackPanel>
        </Grid>
    </toolkit:BusyIndicator>
</controls:ChildWindow>